Interfacing source transformation AD with operator overloading libraries

نویسندگان

  • Kshitij Kulshreshtha
  • Hari Krishna Narayanan
چکیده

Scientific applications are usually written in a single language such as C, C++, or a flavor of Fortran. Various algorithmic differentiation (AD) tools exist to differentiate these applications by using source transformation [1, 2, 3, 4] or operator-overloading [5, 6]. The language that an application is written in often dictates the approach and tool to be used for differentiation. Additionally, performance considerations, tool philosophy (recomputation vs. storage), and specific tool capabilities such as support for sparse Jacobians or fixed-point iterations may play a role in the tool that is ultimately used to differentiate an application. Operator overloading and source transformation have their own strengths and weaknesses. The most important feature of operator-overloading-based AD tools is that they can be used in software regardless of its design complexity. Many large simulation tools (e.g., ISSM [7], SU2 [8, 9]) have been successfully differentiated in this manner. One drawback, however, is the large amount of memory required to store the tool-specific internal representation of the computation in order to run it in the reverse mode. The execution speed also suffers because of low compiler optimization potential. Both problems do not occur in source transformation tools. However, such tools cannot handle runtime features of C++ such as object inheritance, polymorphism, and templating. Some scientific applications are coded in C++ but contain portions that are in C or are C like. Often, the global structure of the application is complex and requires the use of advanced C++ features, but the computationally intensive portions are C functions. In our previous work [10] we successfully demonstrated the interfacing of an application differentiated mainly by using operator overloading with a library that has been differentiated using source transformation. The implementation relies on the externally differentiated function feature of ADOL-C, where such functions have actually been differentiated by using ADIC. The interface works also well with Tapenade. We demonstrated that this mixed approach is able to amortize the memory requirement for the calculation of adjoints and Jacobians on two applications. By using both approaches in the same application wherever they are applicable and well suited, we were able to use the strengths of both approaches. In this work we demonstrate the inverse interface. Here, the global application structure is a straightforward pure C (or Fortran) implementation; however, certain library calls may internally use complicated C++ features. We have created an entirely new interface keeping in mind the features of both ADOL-C and ADIC to support this setup.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Mixed Approach to Adjoint Computation with Algorithmic Differentiation

Various algorithmic differentiation tools have been developed and applied to large-scale simulation software for physical phenomena. Until now, two strictly disconnected approaches have been used to implement algorithmic differentiation (AD), namely, source transformation and operator overloading. This separation was motivated by different features of the programming languages such as Fortran a...

متن کامل

A A Source Transformation via Operator Overloading Method for the Automatic Differentiation of Mathematical Functions in MATLAB

Automatic differentiation, or as it has more recently been termed, algorithmic differentiation, (AD) is the process of determining accurate derivatives of a function defined by computer programs [Griewank 2008] using the rules of differential calculus. The objective of AD is to employ the rules of differential calculus in an algorithmic manner in order to efficiently obtain a derivative that is...

متن کامل

AMOR REPORT 2005/01 Source Transformation for MATLAB Automatic Differentiation

This report describes MSAD, a tool that applies source transformation automatic differentiation to MATLAB programs involving arbitrary vector-valued functions. The transformed programs compute both the results of the original program and the first derivatives. The current version of MSAD performs a complete source transformation for the forward mode of AD by specialising and inlining operations...

متن کامل

Efficient generated libraries for asynchronous derivative computation

The computation of derivatives via automatic differentiation is a valuable technique in many science and engineering applications. While the implementation of automatic differentiation via source transformation yields the highest-efficiency results, the implementation via operator overloading remains a viable alternative for some application contexts, such as the computation of higher-order der...

متن کامل

Algorithmic Differentiation of a Complex C++ Code with Underlying Libraries

Algorithmic differentiation (AD) is a mathematical concept which evolved over the last decades to a very robust and well understood tool for computation of derivatives. It can be applied to mathematical algorithms, codes for numerical simulation, and whenever derivatives are needed. In this paper we report on the algorithmic differentiation of the discontinuous Galerkin solver padge, a large an...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016